//
//  ControlFlowGraphLoopUnitTest.cpp
//  ConstructGccfg2.0
//
//  Created by Bryce Holton on 12/12/12.
//  Copyright (c) 2012 Bryce Holton. All rights reserved.
//

#include "ControlFlowGraphLoopUnitTest.h"
#include "FileParse.h"
#include <assert.h>

void ControlFlowGraphLoopUnitTest::FindLoopExitBlockTest()
{
    ProgramFunction *testFunctions[1];
    FileParse parse("dijkstra_function.c.080t.dom1");
    
    for (int i = 0; i < 1; i++)
    {
        testFunctions[i] = parse.ParseFunction();
        testFunctions[i]->SeparateLoopBlocksFromFunctionBlocks();
        
        ControlFlowGraph *testCfg = testFunctions[i]->GetCfg();
        assert(testCfg != NULL);
        
        for (unsigned int j = 0; j < testFunctions[i]->GetLoops().size(); j++)
        {
            ControlFlowGraphLoop *testLoop = testFunctions[i]->GetLoops()[j];
            assert(testLoop != NULL);
        } 
    }
}
